<div class="container-fluid">
    <div class="row">
        <div class="col-md-12">
            <!-- 基础信息 -->
            <div class="card mb-3">
                <div class="card-header bg-light">
                    <h5 class="mb-0"><i class="fa fa-info-circle"></i> 基础信息</h5>
                </div>
                <div class="card-body">
                    <div class="row">
                        <!-- 左侧：名称、门店Logo、餐饮分类 -->
                        <div class="col-md-6">
                            <!-- 门店名称 -->
                            <div class="form-group mb-4">
                                <label for="store_name" class="form-label">门店名称 <span class="text-danger">*</span></label>
                                <input type="text" class="form-control" id="store_name" value="{{ $pickupPoint['name'] ?? '沙县小吃' }}" placeholder="请输入门店名称" readonly>
                            </div>
                            
                            <!-- 门店Logo -->
                            <div class="form-group mb-4">
                                <label class="form-label">门店Logo <span class="text-danger">*</span></label>
                                <div class="upload-area text-center p-4 border border-dashed rounded">
                                    <i class="fa fa-image fa-2x text-muted mb-2"></i>
                                    <p class="text-muted mb-0">点击或拖拽上传Logo图片</p>
                                </div>
                            </div>
                            
                            <!-- 餐饮分类 -->
                            <div class="form-group mb-0">
                                <label for="category" class="form-label">门店分类 <span class="text-danger">*</span></label>
                                <select class="form-control" id="category" readonly>
                                    <option value="">请选择门店分类</option>
                                    <option value="restaurant" selected>餐饮</option>
                                    <option value="retail">零售</option>
                                    <option value="service">服务</option>
                                    <option value="other">其他</option>
                                </select>
                            </div>
                        </div>
                        
                        <!-- 右侧：经营状态、营业执照 -->
                        <div class="col-md-6">
                            <!-- 经营状态 -->
                            <div class="form-group mb-4">
                                <label class="form-label">经营状态 <span class="text-danger">*</span></label>
                                <div class="mt-2">
                                    <div class="form-check-inline">
                                        <input class="form-check-input" type="radio" name="business_status" id="status_normal" value="normal" checked readonly>
                                        <label class="form-check-label" for="status_normal">正常营业</label>
                                    </div>
                                    <div class="form-check-inline ml-3">
                                        <input class="form-check-input" type="radio" name="business_status" id="status_disabled" value="disabled" readonly>
                                        <label class="form-check-label" for="status_disabled">暂停营业</label>
                                    </div>
                                </div>
                            </div>
                            
                            <!-- 营业执照 -->
                            <div class="form-group mb-0">
                                <label class="form-label">营业执照 <span class="text-danger">*</span></label>
                                @if(isset($pickupPoint['business_license']) && $pickupPoint['business_license'] && $pickupPoint['business_license'] != '未提供')
                                    <div class="mt-2">
                                        <img src="{{ $pickupPoint['business_license'] }}" 
                                             alt="营业执照" 
                                             class="img-fluid rounded border" 
                                             style="max-width: 200px; max-height: 150px; cursor: pointer;"
                                             data-image-src="{{ $pickupPoint['business_license'] }}"
                                             data-image-title="营业执照"
                                             title="点击查看大图">
                                    </div>
                                @else
                                    <div class="upload-area text-center p-4 border border-dashed rounded">
                                        <i class="fa fa-file-alt fa-2x text-muted mb-2"></i>
                                        <p class="text-muted mb-0">未提供营业执照</p>
                                    </div>
                                @endif
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 位置信息 -->
            <div class="card mb-3">
                <div class="card-header bg-light">
                    <h5 class="mb-0"><i class="fa fa-map-marker-alt"></i> 位置信息</h5>
                </div>
                <div class="card-body">
                    <div class="row">
                        <div class="col-md-4">
                            <div class="form-group">
                                <label for="province" class="form-label">所在地区 <span class="text-danger">*</span></label>
                                <select class="form-control" id="province">
                                    <option value="">请选择省份</option>
                                    <option value="hubei" selected>湖北</option>
                                    <option value="beijing">北京</option>
                                    <option value="shanghai">上海</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label for="city" class="form-label">&nbsp;</label>
                                <select class="form-control" id="city">
                                    <option value="">请选择城市</option>
                                    <option value="wuhan" selected>武汉</option>
                                    <option value="yichang">宜昌</option>
                                    <option value="xiangyang">襄阳</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label for="district" class="form-label">&nbsp;</label>
                                <select class="form-control" id="district">
                                    <option value="">请选择区县</option>
                                    <option value="qiaokou" selected>硚口区</option>
                                    <option value="jianghan">江汉区</option>
                                    <option value="wuchang">武昌区</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <div class="form-group">
                                <label for="detailed_address" class="form-label">详细地址 <span class="text-danger">*</span></label>
                                <input type="text" class="form-control" id="detailed_address" value="{{ $pickupPoint['detailed_address'] ?? '' }}" placeholder="请输入详细地址" readonly>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="longitude" class="form-label">经度 <span class="text-danger">*</span></label>
                                <input type="text" class="form-control" id="longitude" value="{{ $pickupPoint['longitude'] ?? '' }}" placeholder="请输入经度" readonly>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="latitude" class="form-label">纬度 <span class="text-danger">*</span></label>
                                <input type="text" class="form-control" id="latitude" value="{{ $pickupPoint['latitude'] ?? '' }}" placeholder="请输入纬度" readonly>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 联系方式 -->
            <div class="card mb-3">
                <div class="card-header bg-light">
                    <h5 class="mb-0"><i class="fa fa-phone"></i> 联系方式</h5>
                </div>
                <div class="card-body">
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="contact_phone" class="form-label">联系电话 <span class="text-danger">*</span></label>
                                <input type="tel" class="form-control" id="contact_phone" value="{{ $pickupPoint['contact_phone'] ?? '' }}" placeholder="请输入联系电话" readonly>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="store_phone" class="form-label">门店电话</label>
                                <input type="tel" class="form-control" id="store_phone" value="{{ $pickupPoint['store_phone'] ?? '' }}" placeholder="请输入门店电话" readonly>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 营业信息 -->
            <div class="card mb-3">
                <div class="card-header bg-light">
                    <h5 class="mb-0"><i class="fa fa-business-time"></i> 营业信息</h5>
                </div>
                <div class="card-body">
                    <div class="row">
                        <div class="col-md-4">
                            <div class="form-group">
                                <label for="opening_time" class="form-label">营业时间 <span class="text-danger">*</span></label>
                                <input type="time" class="form-control" id="opening_time" value="{{ $pickupPoint['opening_time'] ?? '08:00' }}" readonly>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label for="closing_time" class="form-label">&nbsp;</label>
                                <input type="time" class="form-control" id="closing_time" value="{{ $pickupPoint['closing_time'] ?? '22:00' }}" readonly>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label for="establishment_date" class="form-label">首营成立日期</label>
                                <input type="datetime-local" class="form-control" id="establishment_date" value="{{ $pickupPoint['establishment_date'] ?? '' }}" readonly>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 管理人员信息 -->
            <div class="card mb-3">
                <div class="card-header bg-light">
                    <h5 class="mb-0"><i class="fa fa-users"></i> 管理人员信息</h5>
                </div>
                <div class="card-body">
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="manager_name" class="form-label">门店负责人 <span class="text-danger">*</span></label>
                                <div class="d-flex align-items-center">
                                    <div class="avatar avatar-sm rounded-circle mr-3">
                                        <img src="{{ $pickupPoint['manager']['avatar'] ?? '' }}" alt="{{ $pickupPoint['manager']['name'] ?? '未设置' }}" class="rounded-circle" style="width: 40px; height: 40px;">
                                    </div>
                                    <div>
                                        <div><strong>{{ $pickupPoint['manager']['name'] ?? '未设置' }}</strong></div>
                                        <small class="text-muted">ID: {{ $pickupPoint['manager']['id'] ?? '未知' }}</small>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="manager_contact" class="form-label">门店联系人</label>
                                <input type="text" class="form-control" id="manager_contact" value="{{ $pickupPoint['manager_contact'] ?? '' }}" placeholder="请输入联系人姓名" readonly>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 账号信息 -->
            <div class="card mb-3">
                <div class="card-header bg-light">
                    <h5 class="mb-0"><i class="fa fa-user-cog"></i> 账号信息</h5>
                </div>
                <div class="card-body">
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="login_account" class="form-label">登录账号：<span class="text-primary">{{ $pickupPoint['login_account'] ?? '未设置' }}</span></label>
                            </div>
                        </div>
                        <!-- <div class="col-md-6">
                            <div class="form-group">
                                <label for="login_password" class="form-label">登录密码：<span class="text-primary">修改密码</span></label>
                            </div>
                        </div> -->
                    </div>
                </div>
            </div>

            <!-- 操作按钮 -->
            <div class="row">
                <div class="col-md-12 text-right">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 图片查看模态框 -->
<div class="modal fade" id="imageModal" tabindex="-1" role="dialog" aria-labelledby="imageModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="imageModalLabel">
                    <i class="fa fa-image"></i> 图片查看
                </h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body text-center">
                <img id="modalImage" src="" alt="" class="img-fluid">
            </div>
        </div>
    </div>
</div>

<script>
$(document).ready(function() {
    // 使用事件委托处理图片点击事件
    $(document).on('click', 'img[data-image-src]', function() {
        var imageSrc = $(this).data('image-src');
        var imageTitle = $(this).data('image-title');
        showImageModal(imageSrc, imageTitle);
    });
});

function showImageModal(imageSrc, title) {
    $('#imageModalLabel').html('<i class="fa fa-image"></i> ' + title);
    $('#modalImage').attr('src', imageSrc).attr('alt', title);
    $('#imageModal').modal('show');
}
</script>

<style>
.upload-area {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.upload-area:hover {
    border-color: #007bff;
    background-color: #f0f8ff;
}

/* 基础信息两列布局优化 */
.col-md-6 .form-group {
    padding-right: 15px;
}

.col-md-6:last-child .form-group {
    padding-left: 15px;
    padding-right: 0;
}

/* 经营状态样式优化 */
.form-check-inline {
    margin-right: 0;
}

.form-check-inline .form-check-label {
    margin-left: 5px;
    font-weight: normal;
}

.form-check-input:checked ~ .form-check-label {
    font-weight: 500;
}

/* 营业执照上传区域优化 */
.upload-area i.fa-file-alt {
    color: #6c757d;
}

.upload-area i.fa-image {
    color: #28a745;
}

.avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-label {
    font-weight: 500;
    margin-bottom: 5px;
    color: #495057;
}

.text-danger {
    color: #dc3545 !important;
}

.card-header {
    border-bottom: 1px solid #dee2e6;
}

.form-check-inline {
    margin-right: 0;
}

.form-check-inline .form-check-label {
    margin-left: 5px;
}

.btn-group-sm > .btn, .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

input[readonly] {
    background-color: #f8f9fa;
    opacity: 1;
}

select[readonly] {
    background-color: #f8f9fa;
    opacity: 1;
}
</style>